package com.example.hehecat.yuejian1.http;

import com.example.hehecat.yuejian1.mvp.model.bean.ActivityBean;
import com.example.hehecat.yuejian1.mvp.model.bean.ClubBean;
import com.example.hehecat.yuejian1.mvp.model.bean.ClubLessonBean;
import com.example.hehecat.yuejian1.mvp.model.bean.GameBean;
import com.example.hehecat.yuejian1.mvp.model.bean.MasterBean;
import com.example.hehecat.yuejian1.mvp.model.bean.MasterLessonBean;
import com.example.hehecat.yuejian1.mvp.model.bean.PictureBean;
import com.example.hehecat.yuejian1.mvp.model.bean.ReplyBean;
import com.example.hehecat.yuejian1.mvp.model.bean.SuccessBean;
import com.example.hehecat.yuejian1.mvp.model.bean.UserBean;

import java.io.File;
import java.util.List;
import java.util.Map;

import okhttp3.MultipartBody;
import okhttp3.RequestBody;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.http.GET;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.Part;
import retrofit2.http.PartMap;
import retrofit2.http.Query;
import retrofit2.http.QueryMap;
import rx.Observable;

public interface HttpInterface {
    @GET("activity/atvlist")
    Observable<List<ActivityBean>> getAllActivity();

    @GET("activity/atvdetail")
    Observable<ActivityBean> getActivityInfo(@Query("activityid") int activity_id);

    @GET("activity/activityenroll")
    Call<SuccessBean> activityEnroll(@Query("userid") int user_id,
                                     @Query("activityid") int activity_id);

    @GET("game/gameenroll")
    Call<SuccessBean> gameEnroll(@Query("userid") int user_id,
                                     @Query("gameid") int gameid);

    @GET("club/clublist")
    Observable<List<ClubBean>> getAllClub();

    @GET("club/collectclublist")
    Observable<List<ClubBean>> collectClubList(@Query("userid") int user_id);

    @GET("user/login")
    Call<UserBean> login(@Query("username") String username,
                         @Query("password") String password);


    @GET("user/register")
    Call<UserBean> register(@Query("username") String username,
                            @Query("password") String password,
                            @Query("address") String address,
                            @Query("phone") String phone);

    @GET("user/getuser")
    Observable<UserBean> getNickName(@Query("userid") int user_id,
                                     @Query("nickname") String nickname);

    @GET("user/updateuser")
    Call<SuccessBean> updateUser(@Query("userid") int user_id,
                              @Query("nickname") String nickname,
                              @Query("password") String password,
                              @Query("address") String address,
                              @Query("phone") String phone);


    @GET("picture/picturelist")
    Observable<List<PictureBean>> getAllPicture();

    @GET("picture/picturedetail")
    Observable<PictureBean> getPictureInfo(@Query("pictureid") int picture_id);

    @GET("search/activity")
    Observable<List<ActivityBean>> getActivityBySearch(
            @Query("search") String search);

    @GET("search/club")
    Observable<List<ClubBean>> getClubBySearch(
            @Query("search") String search);

    @GET("game/gamelist")
    Observable<List<GameBean>> getAllGame();

    @GET("master/masterlist")
    Observable<List<MasterBean>> getAllMaster();

    @GET("game/gamedetail")
    Observable<GameBean> getGameInfo(
            @Query("gameid") int game_id);

    @GET("club/clubdetail")
    Observable<ClubBean> getclubInfo(
            @Query("clubid") int club_id);

    @GET("master/masterdetail")
    Observable<MasterBean> getMasterInfo(
            @Query("masterid") int master_id);

    @GET("master/collectmasterlist")
    Observable<List<MasterBean>> collectMasterList(@Query("userid") int user_id);

    @GET("activity/collect")
    Call<SuccessBean> collectActivity(@Query("userid") int user_id,
                                      @Query("activityid") int activity_id);

    @GET("activity/iscollect")
    Call<SuccessBean> isActivityCollect(@Query("userid") int user_id,
                                        @Query("activityid") int activity_id);

    @GET("activity/collectactivitylist")
    Observable<List<ActivityBean>> collectActivityList(@Query("userid") int user_id);

    @GET("game/collect")
    Call<SuccessBean> collectGame(@Query("userid") int user_id,
                                      @Query("gameid") int game_id);

    @GET("game/iscollect")
    Call<SuccessBean> isGameCollect(@Query("userid") int user_id,
                                        @Query("gameid") int game_id);

    @GET("game/collectgamelist")
    Observable<List<GameBean>> collectGameList(@Query("userid") int user_id);

    @GET("master/collect")
    Call<SuccessBean> collectMaster(@Query("userid") int user_id,
                                      @Query("masterid") int master_id);

    @GET("master/iscollect")
    Call<SuccessBean> isMasterCollect(@Query("userid") int user_id,
                                        @Query("masterid") int master_id);

    @GET("club/collect")
    Call<SuccessBean> collectClub(@Query("userid") int user_id,
                                      @Query("clubid") int club_id);

    @GET("club/iscollect")
    Call<SuccessBean> isClubCollect(@Query("userid") int user_id,
                                        @Query("clubid") int club_id);

    @GET("activity/getreply")
    Observable<List<ReplyBean>> getActivityReply(@Query("activityid") int activity_id);

    @GET("master/getreply")
    Observable<List<ReplyBean>> getMasterReply(@Query("masterid") int master_id);

    @GET("master/getlesson")
    Observable<List<MasterLessonBean>> getMasterlesson(@Query("masterid") int master_id);

    @GET("club/getlesson")
    Observable<List<ClubLessonBean>> getClublesson(@Query("clubid") int club_id);

    @GET("activity/reply")
    Observable<SuccessBean> replySctivity(
            @Query("activityid") int activity_id,
             @Query("userid") int userid,
             @Query("comment")  String comment);

    @GET("master/reply")
    Observable<SuccessBean> replyMaster(
            @Query("masterid") int master_id,
             @Query("userid") int userid,
             @Query("comment")  String comment);



   @Multipart
    @POST("picture/issuepicture")
    Observable<SuccessBean> doFeedback(@QueryMap() Map<String, String> intro,
                                    @QueryMap() Map<String, String> name,
                                    @QueryMap() Map<String, Integer> userid,
                                    @Part() MultipartBody.Part files);



    @GET("picture/mypicture")
    Observable<List<PictureBean>> myPicture(@Query("userid") int user_id);

    @GET("picture/deletemypicture")
    Call<SuccessBean> deleteMyPicture(@Query("userid") int user_id,
                                      @Query("pictureid") int picture_id);
}